package com.wmx.dubboproducer.producer;

import entity.resp.UserAddressResp;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.stereotype.Component;
import service.UserAddressService;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**********************************
 * @author wmx
 * @date 2019/11/4 16:54
 * @description:
 * @version 1.0
 ************************************/
@Component
@Service(weight = 50 ,validation = "true") // 使用dubbo的注解暴露需要提供的服务

public class UserAddressProducer implements UserAddressService {

    @Override
    public List<UserAddressResp> queryUserAddressByUserId(String userId) {
        System.out.println("服务2被调用");
        UserAddressResp userAddressResp = new UserAddressResp(1,"四川省成都市环球中心w2","1","" +
                "张三","10083","Y");

        UserAddressResp userAddressResp1 = new UserAddressResp(2,"四川省西昌市","2","" +
                "李四","12333","Y");

        return Arrays.asList(userAddressResp,userAddressResp1);
    }
}
